package com.Jack.Test;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import com.Jack.Util.StringUtil;

public class TestStr {

	public static void main(String[] args) {
		/*String str="asdfghjkl;0001GR201707120001";
		
		System.out.println(str.substring(str.indexOf("GR"))+"  "+str.indexOf("GR"));
		System.out.println(str.substring(0,str.indexOf("GR")));
		String [] s=str.split(";");*/
		
		/*int a=201;
		int b=10;
		System.out.println(a/b);
		System.out.println(a%b);*/
		
		/*
		Map<String, String> map = new HashMap<String, String>();
		map.put("sku1^lot1", "lot1");
		map.put("sku1^lot2", "lot2");*/
		
		/*if(map.get("sku1^lot3") == null){
			System.out.println("111");
		}*/
		
		/*for (String string : map.keySet()) {
			System.out.println("key:"+string+",val:"+map.get(string));
		}*/
		/*int x=1;
		int y=2;
		int z=3;
		
		System.out.println(x==0||x<y&&z>y);*/
		
		
		/*String str="1000000001^0000000006";
		String s[] = str.split("\\^");
		System.out.println(s[0]);*/
		
		/*String str1="STORERKEY,SKU,DESCR,HSCODE,LOT,";
		String str2="PARROT,AC00000002,海天招牌拌饭酱1,HSCODE1,0000000397,";
		
		String []str1s = str1.split(",");
		String []str2s = str2.split(",");
		
		StringBuffer sql = new StringBuffer();
		sql.append("update declaration_data set ");
		
		for (int i = 0; i < str1s.length; i++) {
			if(i == str1s.length-1){
				sql.append(str1s[i]+" = '" + str2s[i]+"'");
			}else{
				sql.append(str1s[i]+" = '" + str2s[i] + "',");
			}
		}
		sql.append(" where sku = '" + "AC00000002" +"' and LOTTABLE01 = '" +"0000000397"+ "'" );
		System.out.println(sql);*/
		
		//String str= null;
		
		//System.out.println(StringUtil.isEmpty(str));
		
		//getStr("1","2","3","4","5");
		
		
		/*StringBuffer sb = new StringBuffer();
		sb.append("abcdefg");
		
		sb.delete(2, 3);
		System.out.println(sb.toString());*/
		
		
		/*Map<String, String> map = new HashMap<String, String>();
		map.put("1", "lot1");
		map.put("2", "lot2");
		
		System.out.println(map.get("1"));*/
		/*if(map.get("1") == null){
		}*/
		
		
		/*Date date = new Date();
		SimpleDateFormat df= new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		String str = df.format(date);
		System.out.println(str);*/
		
		/*StringBuffer sb = new StringBuffer();
		sb.append("'1111','2222',");*/
	/*	sb.append("dddd");
		sb.delete(0, 1000);*/
		//String str = sb.toString().substring(0,sb.length()-1);
		
		//sb =new StringBuffer();
		//System.out.println(getStringRandom(5));
		
		/*String str ="0000000020-1";
		String s[] = str.split("-");
		System.out.println(s[0]+"   "+s[1]);*/
		
	/*	double num = 1;
		System.out.println(num);*/
		
		String s = " sdfds f ";
		
		/*if(s.matches("^[\\d,]*$/")){
			System.out.println(true);
		}else{
			System.out.println(false);
		}*/
		
		
		System.out.println(s.toUpperCase());
		
	}
	
	// 生成随机数字和字母,
	public static String getStringRandom(int length) {
	    String val = "";
	    Random random = new Random();
	    // 参数length，表示生成几位随机数
	    for (int i = 0; i < length; i++) {
	        String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
	        // 输出字母还是数字
	        if ("char".equalsIgnoreCase(charOrNum)) {
	            // 输出是大写字母还是小写字母
	             //int temp = random.nextInt(2) % 2 == 0 ? 65 : 97;
	            val += (char) (random.nextInt(26) + 97);
	        } else if ("num".equalsIgnoreCase(charOrNum)) {
	            val += String.valueOf(random.nextInt(10));
	        }
	    }
	    return val.toUpperCase();
	}
	
	/*public static void getStr(String ... str) {
		for (int i = 0; i < str.length; i++) {
			System.out.println(str[i]);
		}
	}*/
	
	
}
